package business.coding.matching

import dao.Center

/**
 * Tupla de un centro y un idCorp que apunta al centro
 * @author 53385255R
 *
 */
class CenterIdCorp {
	
	Center _center
	int _idCorp
	
	CenterIdCorp(Center cen, int idCorp) {
		_center = cen
		_idCorp = idCorp
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((_center == null) ? 0 : _center.hashCode());
		result = prime * result + _idCorp;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		CenterIdCorp other = (CenterIdCorp) obj;
		if (_center == null) {
			if (other._center != null)
				return false;
		} else if (!_center.equals(other._center))
			return false;
		if (_idCorp != other._idCorp)
			return false;
		return true;
	}
	
	@Override
	public String toString() {
		return "Center [PROVINCIA=" + _center.PROVINCIA + ", INSTIT=" + _center.INSTIT + ", ORGANISMO=" + _center.ORGANISMO + ", DPTO=" + _center.DPTO + ", SECTOR=" + _center.SECTOR + "] - idCorp [${_idCorp} ]";
	}
	
	
}
